"""
欢迎界面，标签和图标
"""

import tkinter as tk


# 创建窗口
root = tk.Tk()
root.title("欢迎界面")
root.geometry("400x400+1000+100")

# 创建标签
welcome_label = tk.Label(
    root,
    text="欢迎来到python世界",
    font=("Arial", 20),
    fg="red"
)
welcome_label.pack(pady=20)

# 创建图标
try:
    icon = tk.PhotoImage(file="py.png")
    icon_label = tk.Label(root, image=icon)
    icon_label.pack()
except:
    error_label = tk.Label(root, text="图标加载失败")
    error_label.pack()

root.mainloop()
